package com.tbit.uqbike.client.convert;

import com.tbit.uqbike.client.dto.EventReportDTO;
import com.tbit.uqbike.client.dto.OrderTraceIdApplyDTO;
import com.tbit.uqbike.client.request.EventReportReq;
import com.tbit.uqbike.client.request.OrderTraceIdApplyReq;

/**
 * OrderTraceIdApply 转换器
 *
 *
 * @author <a href="mailto:chen.chaoxiong@tbit.com.cn">ChenChaoXiong</a>
 * @since 2024/7/4
 */
public class OrderTraceIdApplyConverter {

    public static OrderTraceIdApplyDTO toDTO(OrderTraceIdApplyReq apply) {
        if ( apply == null ) {
            return null;
        }

        OrderTraceIdApplyDTO orderTraceIdApplyDTO = new OrderTraceIdApplyDTO();

        orderTraceIdApplyDTO.setBrandId( apply.getBrandId() );
        orderTraceIdApplyDTO.setAccountId( apply.getAccountId() );

        return orderTraceIdApplyDTO;
    }

    public static EventReportDTO toDTO(EventReportReq req) {
        if ( req == null ) {
            return null;
        }

        EventReportDTO eventReportDTO = new EventReportDTO();

        eventReportDTO.setTraceId( req.getTraceId() );
        eventReportDTO.setEventType( req.getEventType() );
        eventReportDTO.setEventDesc( req.getEventDesc() );
        eventReportDTO.setDetail( req.getDetail() );
        eventReportDTO.setEventTime( req.getEventTime() );
        eventReportDTO.setMachineId( req.getMachineId() );
        eventReportDTO.setUserId( req.getUserId() );
        eventReportDTO.setUserPhone( req.getUserPhone() );
        eventReportDTO.setMessage( req.getMessage() );
        eventReportDTO.setBusinessInfo( req.getBusinessInfo() );

        return eventReportDTO;
    }



}
